import request from "@/utils/request";

enum API {
    Index_URL = "/itp/index",
} 
export default{
    getIndexClassify:(param:any)=>request.post(`${API.Index_URL}/management/classify`,param),//查询指标分类
    getIndexDetail:(id:number)=>request.get(`${API.Index_URL}/management/detail?id=${id}`),//查询详情
    saveIndexInfo:(param:any)=>request.post(`${API.Index_URL}/management/save`,param),//保存指标
    detIndexDetail:(id:number)=>request.get(`${API.Index_URL}/management/delete?id=${id}`),//删除指标
    
    getOperateLog: (current: number, size: number,param:any) => request.post(`${API.Index_URL}/log/operator?current=${current}&size=${size}`,param),// 操作日志
    beginCalc: (param:any) => request.post(`${API.Index_URL}/calc`, param),
    beginGenerate:  (indexId:number, date: string) => request.get(`${API.Index_URL}/job/create/one?indexId=${indexId}&date=${date}`),

    getIndexJobPage: (current: number, size: number,param:any) => request.post(`${API.Index_URL}/job/page?current=${current}&size=${size}`,param),
    getIndexJobDetail: (id: number) => request.get(`${API.Index_URL}/job/detail?id=${id}`),
    getIndexJobItemPage: (current: number, size: number,param:any) => request.post(`${API.Index_URL}/job/item/page?current=${current}&size=${size}`,param),

    copyIndex: (id: number) => request.get(`${API.Index_URL}/management/copy?indexId=${id}`),
    createAllJobs: (date: string) => request.get(`${API.Index_URL}/job/create/all?date=${date}`), //执行任务

    postIndexMonitorLog: (current: number, size: number,param:any) => request.post(`${API.Index_URL}/monitor/log/operator?current=${current}&size=${size}`,param),//指标监控日志
}
